package com.yj.core.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;


/**
 * @author Xie
 * @date 19-7-18
 */
@Getter
@Setter
//@Component
//@ConfigurationProperties(prefix = "feign.okhttp")
public class FeignOkHttpClientProperties {

    /**
     * 线程池最大连接数
     */
    private int maxConnections;

    /**
     * 长链接保持时间（单位秒）
     */
    private long timeToLive;

    /**
     * 是否遵循重定向
     */
    private boolean followRedirects;

    /**
     * 创建连接的超时时间（单位毫秒）
     */
    private int connectionTimeout;

    /**
     * 处理请求的超时时间（单位毫秒）
     */
    private int readTimeout;

    public FeignOkHttpClientProperties() {
        this.followRedirects = true;
        this.connectionTimeout = 60000;
        this.readTimeout = 60000;
        this.timeToLive = 60L;
        this.maxConnections = 500;
    }
}
